FE
action

ajuda script talkaction!

Por FelipeXT, 25 de abr. de 2015 em Scripts

talkaction
script skill
script up skill
ajuda
help
script
5
1.5k
FelipeXTF
25 de abril de 2015 às 22:57

Ola galera do XT

Preciso de uma ajudinha em um script de talkaction que fiz!

e um script de um item que add skill no personagem, so que os player podem usar quanto quiserem.

quero colocar para este script subir a skill so ate certo nivel. Versao do ot 7.92

function onSay(cid, words, param)
pos = getPlayerPosition(cid)
pz = getTilePzInfo(pos)

if pz == 0 then

doPlayerSendTextMessage(cid,22,"Voce so pode upar seu skill en protect zone.")
else
if doPlayerRemoveItem(cid, 5891,1) == TRUE then
doPlayerAddSkill(cid,3, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"Você precisa de 1 enchanted chicken wing para upar seu skill.")
end
end
return 1
end

10279291
25 de abril de 2015 às 23:35

function onSay(cid, words, param)
pos = getPlayerPosition(cid)
pz  = getTilePzInfo(pos)

if pz == 0 then
doPlayerSendTextMessage(cid,22,"Voce so pode upar seu skill en protect zone.")
else
if getPlayerItemCount(cid, 5891) > 0 then
doPlayerRemoveItem(cid, 5891,1)
doPlayerAddSkill(cid,3, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"Você precisa de 1 enchanted chicken wing para upar seu skill.")
end
end
return 1
end

Ao usar ele vai remover e adicionar a skill :p

Se caso queira de outro modo só responder xD

gabrielbsalesG
26 de abril de 2015 às 00:05
Melhor resposta

function onSay(cid, words, param)
pos = getPlayerPosition(cid)
pz  = getTilePzInfo(pos)
local skillLimit = 10 --Limite de skill

if getPlayerSkillLevel(cid, 3) >= skillLimit then
doPlayerSendTextMessage(cid,22,"Voce so pode upar seu skill ate ".. (skillLimit) .. ".")
return true
end
if pz == 0 then
doPlayerSendTextMessage(cid,22,"Voce so pode upar seu skill en protect zone.")
else
if doPlayerRemoveItem(cid, 5891,1) == TRUE then
doPlayerAddSkill(cid,3, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"Você precisa de 1 enchanted chicken wing para upar seu skill.")
end
end
return 1
end
local skillLimit = 10

Onde tem 10, você coloca até quanto pode upar.

 

 

Editado Abril 26 por gabrielbsales

FelipeXTF
26 de abril de 2015 às 11:54

 

gabrielbsales o teu script funciono blezinha so tive que mudar o getPlayerSkillLevel para getPlayerSkill pq minha distro n tem esta funçao mas vlw! resolvido o problema REP+

 

gabrielbsalesG
26 de abril de 2015 às 12:10

;D